<div class="button-item">
    <button pButton type="text" class="ui-button-info" icon="fa fa-refresh" (click)="refreshActList()" label="刷新"></button>
    <button pButton type="text" class="ui-button-success" icon="fa fa-fire" label="属性" *ngIf="selectedAct"
        (click)="editAttribute($event)"></button>
    <button pButton type="text" class="ui-button-success" icon="fa fa-filter" label="过滤" *ngIf="selectedAct"
        (click)="editFilter($event)"></button>
    <button pButton type="text" class="ui-button-success" icon="fa fa-rocket" label="事件" *ngIf="selectedAct"
        (click)="editEvent($event)"></button>
</div>
<div class="ui-g ui-g-12">
    <p-table #dt [columns]="cols" [value]="acts" selectionMode="single" [(selection)]="selectedAct" [scrollable]="true"
        scrollHeight="350px">
        <ng-template pTemplate="header" let-columns>
            <tr>
                <th *ngFor="let col of columns" [ngStyle]="col.style">
                    {{col.header}}
                </th>
                <th width="50px"></th>
            </tr>
            <tr>
                <th *ngFor="let col of columns" [ngSwitch]="col.field">
                    <input *ngSwitchCase="'actDefId'" pInputText type="text" style="width:100%;"
                        (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                    <input *ngSwitchCase="'actDefName'" pInputText type="text" style="width:100%;"
                        (input)="dt.filter($event.target.value, col.field, col.filterMatchMode)">
                    <p-dropdown *ngSwitchCase="'timeUnit'" [options]="types" [style]="{'width':'100%'}"
                        (onChange)="dt.filter($event.value, col.field, 'equals')"></p-dropdown>
                </th>
                <th></th>
            </tr>
        </ng-template>
        <ng-template pTemplate="body" let-rowData let-columns="columns">
            <tr [pSelectableRow]="rowData">
                <td *ngFor="let col of columns" [ngStyle]="col.style">
                    {{rowData[col.field]}}
                </td>
                <td style="width:50px;text-align:center;">
                    <i class="fa fa-close" (click)="remove(rowData)"></i>
                </td>
            </tr>
        </ng-template>
    </p-table>
</div>